Skip to content

feat(policy): support Cedar as an alternate sandbox policy language - #4565

Open
vishwa-raman wants to merge 33 commits into
mainfrom
vishwa/cedar-openshell
Open

vishwa-raman wants to merge 33 commits into
mainfrom
vishwa/cedar-openshell

Conversation

@vishwa-raman

Copy link
Copy Markdown
Collaborator

Summary

Implements RFC 0020 (#4564): a sandbox policy can be written in Cedar instead of YAML, chosen once per sandbox and enforced by Cedar alone. YAML sandboxes are unchanged. Draft while the RFC is under review; it is otherwise complete and verified.

Cedar comes from ai-openshell/cedar, the project's own Cedar in the OpenShell CNCF workspace, pinned by commit. OpenShell iterates on policy-language features there with the Cedar team (delimited like today, tracked upstream as cedar-policy/rfcs#115), and does not depend on those features reaching the upstream Cedar release.

Related Issue

Closes #4411

Changes

  • openshell-policy-cedar-schema and openshell-policy-cedar: the canonical schema, strict validation, load-time analysis (Landlock grants, inspected endpoints and paths, policy DNS eligibility, native TCP, address ranges, binary aliases and globs, query keys), evaluation with audit and staged policies, and the token-grant compiler for provider rules.
  • Proto: additive SandboxPolicy fields cedar_policy_source, provider_credential_rules (gateway-managed), and endpoint_settings.
  • CLI, gateway, and supervisor: .cedar policies, the --middleware file (middleware, endpoint settings, process identity), one shared validation, format-switch rejection, and a PolicyEngine that is OPA or Cedar; a Cedar sandbox builds no OPA engine and shares only typed Rust data with the YAML path.
  • Parity harness pairing YAML and Cedar policies through both engines: 2,909 cases on Linux, 2,904 agreeing, 5 deliberate differences; Cedar versions of every example and e2e policy with POLICY_FORMAT=cedar in their scripts; the e2e/cedar suite and its CI matrix entry.
  • Documentation: docs/how-it-works/policies/cedar.mdx, the middleware configuration page, and the crate README.

Testing

  • Checks appropriate to the affected code and behavior pass (fmt, clippy -D warnings, cargo deny, mise run pre-commit; unit tests on macOS and Linux; Windows cross-compile of the supervisor network crate; Go SDK CI)
  • Unit tests added/updated
  • E2E tests added/updated (mise run e2e:cedar, 26 checks)

Checklist

🤖 Generated with Claude Code

@copy-pr-bot

copy-pr-bot Bot commented Oct 14, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

All contributors have signed the DCO ✍️ ✅
Posted by the DCO Assistant Lite bot.

@vishwa-raman
vishwa-raman force-pushed the vishwa/cedar-openshell branch from 9e11281 to d9df6d3 Compare October 14, 2026 20:58
@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

I have read the DCO document and I hereby sign the DCO.

@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

/ok to test d9df6d3

@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

/ok to test dd2c70d

@vishwa-raman
vishwa-raman force-pushed the vishwa/cedar-openshell branch from d9df6d3 to dd2c70d Compare October 15, 2026 15:26
@github-actions

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

New or updated breaking changes; see the full report for all findings.

1. rust-sdk — No explicit risk acceptance found

raw::proto::SandboxPolicy grew cedar_policy_source, provider_credential_rules, and endpoint_settings, whereas the baseline generated struct ended at network_middlewares.

2. go-sdk — No explicit risk acceptance found

Zero-valued types.SandboxPolicy JSON gains CedarPolicySource, ProviderCredentialRules, and EndpointSettings because the new exported fields have no omitempty tags.

  • Impact: Consumers persisting, snapshotting, or validating encoding/json output receive three unexpected keys even when they do not use Cedar.
  • Action: Add json:",omitempty" to the three new curated fields or implement compatible JSON marshaling so omitted Cedar fields preserve baseline output.
  • PR: feat(policy): support Cedar as an alternate sandbox policy language #4565

3. typescript-sdk — No explicit risk acceptance found

Regenerating the exported SandboxPolicy type adds required cedarPolicySource, providerCredentialRules, and endpointSettings properties to the baseline six-field message shape.

  • Impact: Existing consumers that directly construct object literals typed as the exported SandboxPolicy fail TypeScript compilation until all three properties are supplied.
  • Action: Defer the fields to a minor train or export a compatibility SandboxPolicy type with the new members optional from both SDK entry points.
  • PR: feat(policy): support Cedar as an alternate sandbox policy language #4565
Review details
  • Execution: complete
  • Candidate: PR #4565 (876eec79b98c26dee4f4bed7e78ffe84c951d1cb)
  • Baseline: c06ba109c63ccc9cdab5c1ad604f208ef5c2f1d7 (c06ba109c63ccc9cdab5c1ad604f208ef5c2f1d7)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

@vishwa-raman vishwa-raman added test:e2e Requires end-to-end coverage test:windows Run native Windows x64 and ARM64 lint/tests on PR mirrors labels Oct 15, 2026
@github-actions

Copy link
Copy Markdown

Label test:e2e applied for dd2c70d. Open the existing run and click Re-run all jobs to execute with the label set. The run will execute the standard E2E suite after building the required gateway, sandbox, and supervisor images once. The matching required CI gate status on this PR will flip green automatically once the run finishes.

@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

Compatibility risk acceptance for the SandboxPolicy additions (cedar_policy_source, provider_credential_rules, endpoint_settings):

  1. rust-sdk: accepted. The fields are additive proto fields, the evolution pattern proto/README.md prescribes; consumers using exhaustive struct literals or patterns on raw::proto::SandboxPolicy need to add the three fields or use ..Default::default().
  2. go-sdk: accepted. The curated domain types carry no JSON tags on any field, so zero-valued output has always listed every field; the three new keys follow that existing shape.
  3. typescript-sdk: accepted. The generated SandboxPolicy type gains three required properties, as every additive message field does; consumers constructing literals should spread create(SandboxPolicySchema) or supply the fields.

These fields are the wire representation of RFC 0020 (#4564) and cannot be deferred without deferring the feature.

@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

/ok to test 55b998e

@vishwa-raman
vishwa-raman force-pushed the vishwa/cedar-openshell branch 3 times, most recently from dd2c70d to 486f456 Compare October 16, 2026 03:46
@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

/ok to test 486f456

@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

New or updated breaking changes; see the full report for all findings.

1. rust-sdk — Risk explicitly accepted

raw::proto::SandboxPolicy grew cedar_policy_source, provider_credential_rules, and endpoint_settings; the baseline generated struct ended at network_middlewares.

2. go-sdk — Risk explicitly accepted

Zero-valued types.SandboxPolicy JSON now includes CedarPolicySource, ProviderCredentialRules, and EndpointSettings because the new exported fields lack omitempty tags.

3. typescript-sdk — Risk explicitly accepted

Regenerating the exported SandboxPolicy message adds required cedarPolicySource, providerCredentialRules, and endpointSettings properties to the baseline six-field type.

  • Impact: Existing consumers directly constructing object literals typed as SandboxPolicy fail TypeScript compilation until they supply the new properties.

  • Action: Material update: the PR author now accepts the risk, but v0.1.5 must defer these fields to v0.2.0 or export a compatibility type with optional new properties and migration guidance.

  • PR: feat(policy): support Cedar as an alternate sandbox policy language #4565

  • Acceptance: comment

Review details
  • Execution: complete
  • Candidate: PR #4565 (f64069741c9bbdcc8b3856a04ffed5557b82b25e)
  • Baseline: b2069a267c7c8c7cb9a8b652792167dab886cd83 (b2069a267c7c8c7cb9a8b652792167dab886cd83)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

/ok to test 4cdee2a

@vishwa-raman
vishwa-raman force-pushed the vishwa/cedar-openshell branch from 486f456 to 4cdee2a Compare October 16, 2026 05:11
@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

/ok to test 77f4818

@vishwa-raman
vishwa-raman force-pushed the vishwa/cedar-openshell branch from 4cdee2a to 77f4818 Compare October 16, 2026 16:35

Copy link
Copy Markdown
Collaborator

@vishwa-raman — aggregated panel review of commit 77f4818d5c1dbbab3e605f3ffc910f28e008f67b.

I recommend changes before merge and splitting this PR into four PRs. The panel found six code defects and one required documentation update. I verified and deduplicated these through source and caller tracing; the failure scenarios below were not executed locally.

  1. Gateway validation can allocate approximately 10 GB from a 200 KB policy.
    Host-overlap analysis allocates a matrix proportional to both hostname lengths before comparing them. Two 100,000-character endpoint literals fit within the gateway’s 262,144-byte policy limit but trigger roughly ten billion Boolean elements. Neither ordinary Cedar endpoint parsing nor the pinned Cedar parser rejects these lengths. A caller authorized to submit sandbox policies could exhaust gateway memory before a sandbox starts. Bound hostname lengths and overlap-analysis work, and use direct comparison for literal hosts. Host-overlap allocation

  2. An older gateway silently interprets Cedar policy as YAML.
    The new CLI sends version: 1, with Cedar restrictions carried exclusively in a new protobuf field. A pre-Cedar gateway discards that field and accepts an empty YAML policy. Attached providers then contribute their usual YAML access grants—even when the submitted Cedar policy forbids that access. Previously, the CLI rejected Cedar input. Add fail-closed capability/version negotiation and a mixed-version regression test. The existing stable_placeholder capability check provides a precedent. Cedar policy construction

  3. Ordinary resource conditions can bypass GraphQL path restrictions.
    The helper detecting resource.protocol also returns true for resource.port and resource.host: it recursively reaches their underlying resource variable. Consequently, a general REST permit can survive the filtering intended to make a query-only GraphQL path authoritative, allowing mutations. Wildcard-host permits naturally trigger this because they contain host/port conditions. Stop traversal at attribute accesses and add exact-host and wildcard-host regressions. Attribute traversal

  4. Cedar loses the sandbox-wide WebSocket buffering limit.
    Each Cedar tunnel receives a fresh assembly budget. YAML shares one budget across tunnels and reloads, limiting concurrent message assemblies to 32. With Cedar, many connections can each buffer fragmented messages up to the per-message limit without contending for that aggregate bound, potentially exhausting supervisor memory. Store one budget on the Cedar engine and clone it across both upgrade paths and reloads. Per-tunnel budget construction

  5. Staged policies can deny otherwise allowed traffic.
    Staged evaluation errors propagate after the enforced decision has already allowed a request. Additionally, staged rules contribute query keys to enforcement’s combination budget: adding a staged rule reading two keys can make 65 × 64 values exceed the 4,096-combination limit and deny previously allowed traffic. This contradicts the documented promise that staged policies do not change decisions. Separate enforced query analysis and evaluation from staged diagnostics, preserving the enforced result when staging fails. Staged evaluation

  6. Cedar MCP endpoints disappear from connection diagnostics.
    Cedar endpoint configurations lack endpoint_id, so the observer ignores them. Gateway and supervisor inventories also enumerate only network_policies, which valid Cedar policies leave empty. Corresponding YAML endpoints report successful and failed exchanges; Cedar users lose the documented tool-server status and troubleshooting information. Derive consistent endpoint identities and inventories from Cedar inspection metadata across all three layers. Cedar endpoint construction

  7. Public agent skills prescribe a broken Cedar editing workflow.
    The CLI skill exports every policy to current-policy.yaml, delegates YAML network_policies generation, then submits that file. Cedar output fails that workflow through parsing or format-switch rejection. Update the CLI and policy-generation skills to preserve the format and handle the separate middleware file. This is a companion update required by AGENTS.md’s Skill Maintenance rule. Existing editing instructions

I recommend this split because the PR combines an existing-engine refactor, a new language implementation, feature activation, and example expansion. Those have different review and rollback boundaries.

PR Scope Required validation
1. Shared runtime refactor Extract endpoint types, policy data, middleware selection, and binary resolution while retaining YAML behavior. Existing YAML regressions and policy-hash compatibility.
2. Standalone Cedar engine Schema, validation, analysis, evaluator, provider-rule compiler, dependency pin, and packaging changes. Keep public Cedar submission disabled. Engine tests, bounded-input checks, and focused semantic regressions.
3. Complete feature integration Proto/SDK, CLI, gateway validation/composition, supervisor enforcement, filesystem handling, credentials, reload, diagnostics, docs, and skills. Core parity coverage, Cedar/MCP E2E, mixed-version rejection, and credential attachment/reload tests.
4. Remaining examples Additional demo conversions, governance smoke support, and example-specific tests. Relevant example smoke tests and policy comparisons.

PRs 1 and 2 can be reviewed independently; PR 3 depends on both. Keep Cedar acceptance and its complete enforcement path together. Splitting CLI, gateway, and supervisor activation into independently enabled changes would create unsafe intermediate states. Tests needed to establish safe enforcement belong with their implementation.

The verification review also identified two limits worth addressing:

  • One wildcard parity fixture pairs wildcard YAML inspection with Cedar inspection of only api.example.com, then probes only that host. Correct the fixture and exercise a second host through the relay. The reported parity count establishes agreement on selected probes.
  • The new Cedar E2E creates no attached provider, while credential parity primarily checks owner selection. Add an E2E covering attachment without access, permitted credential injection, denial without injection, and credential reload.

The panel comprised independent reviews of Cedar semantics, runtime enforcement, authoring/control-plane integration, and the full parity/example corpus, followed by an independent semantic recheck. No additional concrete filesystem widening, token-grant authorization defect, or YAML regression survived verification. New-gateway/old-supervisor compatibility remains unverified.

Reviewed head 77f4818d5, against merge base 6546691d5; the recorded main tip was a4c848adb. Reproduce with git diff 6546691d5 77f4818d5. No uncommitted work was included, and the workspace remained unchanged.

Local diff and syntax checks passed. At review time, exact-head branch CI had passed Rust tests on Linux/macOS and Go/TypeScript SDK checks; integration CI had passed Cedar and MCP-Cedar E2E. Other runtime jobs were still running at the last review check. Rust/Cargo was unavailable locally, so the new failure scenarios still need executable regression tests. Review status: findings.

@vishwa-raman
vishwa-raman force-pushed the vishwa/cedar-openshell branch from 77f4818 to 77d3238 Compare October 16, 2026 17:30
Bring the branch up to date with main (9a85667), which hosts sandboxes
on a shared supervisor and isolates networking state per sandbox
instance.

Conflict resolution:
- openshell-supervisor: the policy poll loop keys on the per-instance
  `gateway` from main and the `PolicyEngine` from this branch.
- openshell-supervisor-network: `run_networking` keeps main's
  per-instance token-grant resolver and denial log; the OPA import is
  gone because the engine is reached through `PolicyEngine`.
- openshell-server: keep main's rewritten authorization test together
  with the assertion that `Health` stays callable by ordinary users for
  Cedar capability discovery.
- Cargo.lock: main's rustls-webpki and webpki-roots versions are kept;
  Cedar's regex requirement is retained.

Adapt tests that main added since the merge base: the passthrough relay
test selects middleware through `PolicyEngine::passthrough_middleware`,
the Cedar mixed-version test builds a `GatewayEndpoint`, and the testkit
sandbox configuration fetch advertises Cedar support.

Refs #4474

Signed-off-by: Vishwanath Raman <vishwanathr@nvidia.com>
@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

/ok to test 1bd37b1

Bring the branch up to date with main (c4688aa). The Windows test
repairs on main (92434dc) cover the same tests this branch had
stabilized, so the conflicts resolve to main's versions: the mutation
guard stress test yields until its deadline instead of counting yields,
and the startup write-refusal scenarios gate baseline enrichment on Unix
with main's wording. The `PolicySource` import that resolution needs is
restored.

Refs #4474

Signed-off-by: Vishwanath Raman <vishwanathr@nvidia.com>
@vishwa-raman

Copy link
Copy Markdown
Collaborator Author

/ok to test 2927646

@vishwa-raman
vishwa-raman marked this pull request as ready for review October 26, 2026 15:52
@drew

drew commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

I’d like Cedar to be an explicit opt-in feature, enabled in published Release Dev artifacts and excluded from stable releases.

  • Make openshell-policy default features empty and Cedar optional. Forward a cedar feature through the gateway/supervisor, and gate Cedar modules and dependencies with #[cfg(feature = "cedar")]. This should remove the repeated default-features = false changes in unrelated crates.
  • Enable Cedar explicitly in the Release Dev workflow; leave it off for stable builds. Add CI coverage for both configurations and verify that stable binary dependency graphs contain no Cedar engine.
  • Keep Cedar parsing, validation, warnings, filesystem-grant derivation, and provider-rule adaptation inside the policy implementation. For example, have the gateway return validation warnings rather than linking Cedar into the CLI.
  • Keep CLI/core/SDK changes limited to document transport, rendering, hashing, and capability negotiation. Providers and compute drivers—including MXC—should remain unaware of the policy language.
  • Derive supports_cedar_policy from the compiled feature instead of advertising it unconditionally.

The intended boundary is: clients transport policy documents; providers supply credential rules; drivers launch workloads; the gateway and supervisor own Cedar support.

Cedar sandbox policies now ship only in builds that enable the gateway and
supervisor `cedar` Cargo feature. Release Dev and branch E2E enable it;
prerelease and stable builds exclude the Cedar engine.

- openshell-policy has no default features. Cedar validation, load
  warnings, filesystem-grant derivation, and provider-rule conversion live
  in its gated `cedar` module; clients carry Cedar documents as text.
- openshell-supervisor-network gates its Cedar engine behind `cedar`; builds
  without it use an uninhabited stub that rejects Cedar policies.
- The gateway and supervisor derive supports_cedar_policy from the compiled
  feature. A gateway without Cedar rejects Cedar on create, update, start,
  and stored-policy reads, and skips such sandboxes in store-wide checks.
- The gateway returns policy load warnings (PolicyWarning) from
  CreateSandbox and sandbox UpdateConfig, including on replay; the CLI
  prints them and no longer links Cedar.
- Compute drivers report driver_enforces_policy, and the gateway rejects
  Cedar for drivers that enforce policy themselves, such as MXC.
- CI lints and tests both configurations, verifies stable dependency graphs
  exclude Cedar, and release builds fail if a binary embeds a Cedar crate.
- The Cedar docs page is published only on the dev docs site.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
@johnnygreco

johnnygreco commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Note

🤖 Claude Opus 5.5 responding on behalf of johnnygreco

@drew Your Cedar feedback is addressed in 46978de. Please confirm the three interpretations below; nothing else needs a decision.

Cedar is now opt-in: openshell-policy has no default features, only the gateway and supervisor forward a cedar feature, and Release Dev and branch E2E pass cedar explicitly. Stable and prerelease builds exclude the Cedar engine. tasks/scripts/verify-cedar-boundary.sh checks the stable dependency graphs in CI, and release builds fail if a shipped binary embeds a Cedar crate.

  1. Stable CLIs still read and send .cedar files, without the Cedar engine. This follows "clients transport policy documents." Against a stable gateway, the CLI stops before changing anything and says Cedar requires a development build. We read this as an intended exception to RFC 0014's rule that stable CLIs exclude unreleased features.
  2. The Cedar proto fields stay in v1. The SandboxPolicy fields cedar_policy_source, provider_credential_rules, and endpoint_settings are unchanged, per the risk acceptance on this PR; so are the supports_cedar_policy capability fields. The two new v1 fields aren't tied to Cedar: policy_warnings on create and update responses, and driver_enforces_policy on compute driver capabilities.
  3. Provider-rule adaptation lives in the policy layer. Validation and conversion to Cedar are in openshell_policy::cedar. The supervisor keeps only binary resolution inside the sandbox and the L7 normalization it shares with the YAML engine. openshell-providers is unchanged from main.

Changes beyond your comment:

  • MXC reports driver_enforces_policy, and the gateway rejects Cedar for such drivers. Previously, MXC's policy mapper dropped cedar_policy_source and ran the sandbox under an empty YAML policy.
  • A gateway built without Cedar refuses to start, update, or serve stored Cedar sandboxes, but still starts itself.
  • The Cedar docs page is published only on the dev docs site.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
Address the review findings on the Cedar policy support.

Engine robustness:
- Bound policy text before parsing (size, bracket nesting, expression
  depth) with a non-recursive scan, and run loading and evaluation on a
  stack sized for those bounds, so no policy within the gateway limit or
  request the proxy delivers can exhaust a worker stack.
- Deny requests whose inspected strings exceed 16 KiB, bounding the
  delimited `like` recursion.
- Decide GraphQL paths by ignoring excluded permits in one evaluation
  instead of building per-path policy set copies.

Analysis:
- Bucket and budget host-overlap checks.
- Warn on audit paths beside enforced policies of overlapping entries.
- Keep staged policies from creating inspection, paths, or protocols,
  and warn when they would never be evaluated.
- Reject forbids that read `destination_ip` without a guard, and
  policies that read `principal.user` or `principal.group`.

Runtime and control plane:
- Close open Cedar tunnels when authored middleware configs change.
- Reject `tls: skip` endpoint settings on endpoints Cedar inspects, and
  keep inspecting them when a provider rule sets `tls: skip`.
- Report Cedar support in `SupervisorHello` and deliver a not-admitted
  configuration instead of a Cedar policy to supervisors without it.
- Reject incremental policy updates on Cedar sandboxes in the gateway
  and CLI.
- Re-resolve binary aliases when a policy staged before startup commits.
- Keep OPA result conversion outside the engine lock and project only
  consumed fields; document the policy-DNS identity contract.
- Test the provider-rule JSON contract end to end.

Docs: Cedar limits, `tls: skip`, staged and audit semantics, tested
drivers, and the Cedar dependency pin.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
Adapt main's suspend and resume support to the Cedar changes: resume
applies the start path's Cedar support and driver checks, new
SandboxResponse constructions carry policy_warnings, tests match the
boxed sandbox subcommand, and the reviewed schema fingerprints cover
both sides.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
@johnnygreco

Copy link
Copy Markdown
Collaborator

/ok to test 1265969

@github-actions

Copy link
Copy Markdown

Compatibility review (advisory)

New or updated breaking changes; see the full report for all findings.

1. rust-sdk — No explicit risk acceptance found

Six existing raw::proto message structs gain supports_cedar_policy, policy_warnings, or driver_enforces_policy fields.

  • Impact: Exhaustive literals and patterns fail to compile, including constructors in mock servers, supervisor adapters, and compute-driver implementations; generated service traits and ordinary client calls remain unchanged.
  • Action: Preserve the baseline exported message shapes for v0.1.6, or defer their expansion to a minor train with literal and pattern migration guidance.
  • PR: feat(policy): support Cedar as an alternate sandbox policy language #4565

2. typescript-sdk — No explicit risk acceptance found

Existing raw messages gain required supportsCedarPolicy or policyWarnings properties, and curated UpdateConfigResult gains required policyWarnings.

  • Impact: Consumers constructing exact message objects or UpdateConfigResult mocks fail TypeScript compilation, while RPC inputs using MessageInitShape remain compatible.
  • Action: Make the new properties optional on compatibility-facing types in v0.1.6, or defer the required-property changes to a minor train with construction guidance.
  • PR: feat(policy): support Cedar as an alternate sandbox policy language #4565

3. go-sdk — No explicit risk acceptance found

encoding/json output for ConfigUpdateResult gains PolicyWarnings:null even when an update returns no warnings.

Review details
  • Execution: complete
  • Candidate: PR #4565 (c565e54c6df831a1497f8ce624945aca3a99b053)
  • Baseline: e5adf6f484d6b7d3f3d21d5a864f95d3350194fd (e5adf6f484d6b7d3f3d21d5a864f95d3350194fd)
  • Reviewed: rust-sdk, python-sdk, go-sdk, typescript-sdk, api-behavior, cli, configuration, policy, helm, state

Advisory review; publication gates are unchanged.

Branch check run

Engine:
- Reject Cedar policies that test which process the principal is.
  Every request is evaluated as one placeholder process, so such a test
  never matches, and a forbid written that way never applied.
- Deny hosts with an empty DNS label before evaluating policies. Host
  globs matched them, but inspection did not select them, so glob
  HttpRequest forbids were skipped.
- Bound the work of one request's query-value combinations by the size
  of the evaluated policy set (16,384 policy evaluations, at most 1,024
  combinations).
- Summarize CedarEngine in Debug instead of walking every policy's
  expression tree outside the grown stack.

Build and CI:
- Reject a second stacker version in cargo-deny; Cedar's stack checks
  share its thread-local.
- Require the Cedar crates in Cedar-enabled gateway and supervisor
  binaries, a positive control for the stable forbidden-crates check.

CLI: print Cedar policy text without YAML highlighting.

Docs: `tls: skip` for clients that pin certificates or present client
certificates, and the new principal, host, and query limits.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
@johnnygreco

Copy link
Copy Markdown
Collaborator

/ok to test 43b8944

Keep the per-policy evaluation budget, which bounds the work of one
request for large policy sets, but restore 4,096 combinations as the
ceiling RFC 0020 specifies.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
- Compile correlated_endpoint only where it is called: on Linux, and in
  Cedar-enabled tests.
- Expect needless_pass_by_ref_mut on the non-Unix SuspendSignal::recv,
  which keeps the Unix receiver's signature.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
- Load a Cedar policy once per supervisor startup and reload:
  validation hands its engine to the Cedar network engine, and startup
  reads filesystem grants from that engine.
- Convert Cedar inspection protocols to proxy protocols with an
  exhaustive match instead of a string label.
- Share path specificity with the relay, endpoint port selection, the
  endpoint selector match, and the `tls: skip` overlap check between the
  gateway and supervisor.
- Document why Cedar's exact host overlap and core's conservative
  overlap both exist, and test that core's covers Cedar's.
- Walk Cedar expressions with one visitor, and split policy analysis
  into per-action collectors.
- Split cedar_only.rs into engine, routes, L7, destination, and test
  modules.
- Name the Cedar policy check (`SandboxPolicy::is_cedar`) and the
  gateway and supervisor Cedar support checks.
- Group argument lists in Cedar evaluation and provider-rule
  compilation into structs.
- Import shared types from policy_types and policy_engine; keep the opa
  re-exports as transitional.
- Document the policy engines in the supervisor-network README.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
Signed-off-by: Johnny Greco <jogreco@nvidia.com>
@johnnygreco

Copy link
Copy Markdown
Collaborator

/ok to test 12f73d0

`cargo check -p openshell-gateway` accepts features of the gateway's direct
dependencies only, so openshell-prover/prebuilt-z3 failed the check.
openshell-server/prebuilt-z3 enables the prover's.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

/ok to test 203d66098f6ff4e94d6b1aab51dc7c6c03e3dd29

@johnnygreco, there was an error processing your request: E2

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/

@johnnygreco

Copy link
Copy Markdown
Collaborator

/ok to test 203d660

- Restore main's POSIX socket path in the isolation registration
  round-trip test; registration validates POSIX-absolute paths on every
  host, so a Windows temp path is rejected.
- Run the shared host tests only on Unix, where hosted sandbox instances
  are supported.

Signed-off-by: Johnny Greco <jogreco@nvidia.com>
@johnnygreco

Copy link
Copy Markdown
Collaborator

/ok to test 7f95f83

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e Requires end-to-end coverage test:windows Run native Windows x64 and ARM64 lint/tests on PR mirrors

Projects

Status: Planning

Development

Successfully merging this pull request may close these issues.

feat(policy): Cedar as a policy language in OpenShell

3 participants